function myFunction(){

var values = "";
	var numbers = "0123456789";
	var lower = "abcdefghijklmnopqrstuvwxyz";
	var upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var pass="";
	var num_flag = confirm("will contain numbers ?");
	var lower_flag = confirm("will contain lowercase ?");
	var upper_flag = confirm("will contain uppercase?");
	var number1 = prompt("how manny length of password do you want: ","");
	var passlength=parseInt(number1);
	if (num_flag){
	values+=numbers;
	}
	if (lower_flag){
	values+=lower;
	}
	if(upper_flag){
	values+=upper;
	}
	var x= 0;
	while (x < passlength){
		var rand=Math.floor(Math.random()*values.length); // random number 
		var num1=values.charAt(rand); // gets the char 
		pass+=num1;
		
		x++;
		}
	document.write(pass);
}